<template>
	<view class="beijing1">
		<view class="" style="position: fixed; top: 0; z-index: 0">
			<image src="/static/beitu.png" mode="" style="width: 100vw; height: 100vh"></image>
		</view>
		<view class="" style="position: fixed; bottom: 0; right: 0; z-index: 0">
			<image src="/static/zhang.png" mode="" style="width: 374rpx; height: 640rpx"></image>
		</view>
		<u-navbar :placeholder="true" title="添加优惠券" @rightClick="rightClick" :autoBack="true" bg-color="transparent"></u-navbar>
		<view class="beijing" style="position: relative">
			<view class="" style="background: #ffffff; border-radius: 20rpx; padding: 40rpx; margin-top: 60rpx">
				<view class="" style="font-weight: 400; font-size: 30rpx; color: #222222">优惠券码</view>
				<view class="" style="padding: 30rpx 0">
					<u--input placeholder="请输入优惠券码" border="0" v-model="no"></u--input>
				</view>
				<view class="center" style="background: #8c1608; border-radius: 20rpx; height: 90rpx" @click="ti">
					<text style="font-weight: 400; font-size: 30rpx; color: #fefefe">提交</text>
				</view>
			</view>
			<view class="" style="margin-top: 60rpx">
				<view class="" style="font-weight: 400; font-size: 26rpx; color: #8c1608">优惠券说明</view>
			</view>
			<view class="" style="margin-top: 34rpx; font-weight: 400; font-size: 24rpx; color: #888888">
				<u-parse :content="state.xieyi.coupon_des"></u-parse>
			</view>
		</view>
	</view>
</template>

<script>
import { couponexchange } from '../../untils/api.js';
export default {
	data() {
		return {
			no: ''
		};
	},
	onLoad(ops) {},
	onShow() {},
	methods: {
		async ti() {
			uni.showLoading({
				title: '加载中',
				mask: true
			});

			const data = await couponexchange({
				no: this.no
			});
			if (data.code == 1) {
				uni.showToast({
					icon: 'none',
					title: '操作成功',
					duration: 2000
				});
				setTimeout(() => {
					uni.navigateBack({
						delta: 1
					});
				}, 1000);
			}
		},
		rightClick() {
			console.log('rightClick');
		},
		leftClick() {
			console.log('leftClick');
		},
		scrolltolower() {
			console.log('到底了');
		}
	}
};
</script>

<style lang="scss" scoped>
::v-deep .u-input {
	background: #f5f5f5 !important;
	height: 90rpx !important;
}
.sl1 {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
	-webkit-line-clamp: 1;
}
.sl2 {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
	-webkit-line-clamp: 2;
}
.beijing {
	overflow: hidden;
	padding: 0 25rpx;
}
.beijing1 {
	min-height: 100vh;
	background-color: #f0e8dc;
	//系统tabbar不要加注释掉
	padding-bottom: env(safe-area-inset-bottom);
	box-sizing: border-box;
}
</style>
